<template>
  <div class="card-view">
    <div class="header">
      <div class="title">{{ title }}</div>
      <div class="opt">
        <slot name="opt"></slot>
      </div>
    </div>
    <div class="content">
      <slot></slot>
    </div>
  </div>
</template>

<script setup lang="ts">
defineProps({
  title: {
    type: String,
    default: '',
  },
});
</script>

<style lang="less" scoped>
.card-view {
  background: #fff;

  & + .card-view {
    margin-top: 16px;
  }

  .header {
    height: 56px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e9e9e9;

    .title {
      color: rgb(0 0 0 / 85%);
      font-size: 16px;
    }

    .opt {
      height: 100%;
      display: flex;
      align-items: center;
    }
  }

  .content {
    padding: 0 32px 24px;
  }
}
</style>
